unzip configcentre.zip
cd configcentre
rm -rf log/*
cd config
rm -rf areacfg_*
cd ..
cd ..
cp -r config configcentre

unzip sdklogin.zip
cd sdklogin
rm -rf log/*
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

unzip loginservice.zip
cd loginservice
rm -rf log/*
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

unzip ginfoservice.zip
cd ginfoservice
rm -rf log/*
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

chmod +x /3kserver/configcentre/start.sh
chmod +x /3kserver/sdklogin/start.sh
chmod +x /3kserver/loginservice/start.sh
chmod +x /3kserver/ginfoservice/start.sh

chmod +x /3kserver/configcentre/stop.sh
chmod +x /3kserver/sdklogin/stop.sh
chmod +x /3kserver/loginservice/stop.sh
chmod +x /3kserver/ginfoservice/stop.sh

cp config/commonconfig.lua gamebase/configarea/

cp -r gamebase center/
cd center
sed -i 's/nodename = "role"/nodename = "center"/' serverconfig
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

cp -r gamebase gate/
cd gate
sed -i 's/nodename = "role"/nodename = "gate_1"/' serverconfig
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

cp -r gamebase role/
cd role
sed -i 's/nodename = "role"/nodename = "role_1"/' serverconfig
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

cp -r gamebase guild/
cd guild
sed -i 's/nodename = "role"/nodename = "guild_1"/' serverconfig
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

cp -r gamebase chat/
cd chat
sed -i 's/nodename = "role"/nodename = "chat"/' serverconfig
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

cp -r gamebase map/
cd map
sed -i 's/nodename = "role"/nodename = "map"/' serverconfig
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

chmod +x /3kserver/center/start.sh
chmod +x /3kserver/gate/start.sh
chmod +x /3kserver/role/start.sh
chmod +x /3kserver/guild/start.sh
chmod +x /3kserver/chat/start.sh
chmod +x /3kserver/map/start.sh

chmod +x /3kserver/center/stop.sh
chmod +x /3kserver/gate/stop.sh
chmod +x /3kserver/role/stop.sh
chmod +x /3kserver/guild/stop.sh
chmod +x /3kserver/chat/stop.sh
chmod +x /3kserver/map/stop.sh

# mailservice

cp -r mailservice mailservice1/
cd mailservice1
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

cp -r mailservice mailservice2/
cd mailservice2
sed -i 's/servicenode = 100/servicenode = 101/' serverconfig
sed -i 's/configcentre = "192.168.1.81:8901"/configcentre = "192.168.1.82:8901"/' serverconfig
cd ..

chmod +x /3kserver/mailservice1/start.sh
chmod +x /3kserver/mailservice2/start.sh

chmod +x /3kserver/mailservice1/stop.sh
chmod +x /3kserver/mailservice2/stop.sh